		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td height="10"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
			</tr>
			<tr>
				<td height="1" bgcolor="#ADB9BF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
			<tr>
				<td height="1" bgcolor="#E4E9EC"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
			<tr>
				<td height="10"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
			</tr>
		</table>		
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td height="1" bgcolor="#C4CDD2"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
			</tr>			
		</table>
		<table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #C4CDD2; border-top:0px;">
			<tr>
				<td width="1" bgcolor="#DBE1E5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				<td style="border:5px solid white; border-bottom:0px">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td style="border:1px solid #8CA2B1; ">
<form name="child_list" action="index.php" enctype="multipart/form-data" method="post">
<input name="admin" type="hidden" value="1">
<input name="module" type="hidden" value="letters">
<input name="mod" type="hidden" value="jobs">
<input name="act" type="hidden" value="import">
<input name="parent" type="hidden" value="{$smarty.get.job_id}">
<input name="referer" type="hidden" value="{ext->get_referer}">


{ext->class_function class="letters" func="get_job_data" job=$smarty.get.job_id assign="job_data"}	
{ext->class_function class="letters" func="get_job_emails" job=$smarty.get.job_id assign="job_emails"}			
{*debug var=$job_data*}

<table width="100%" cellpadding="0" cellspacing="0">
	
	<tr>
		<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
		<td width="200" height="25">{t t='Pasirinkite šaltinį'}:</td>		
		<td style="padding:10px 0px 10px 0px " width="1">
		<select name="source_type_soft" style="width:250px " onChange="doTheFiltering(this,'source_type_soft')">
			<option value=""></option>
			{if $site_permission.clients == 1}<option value="clients" {if ($job_data.source_type == 'clients' && !$smarty.get.source_type_soft) || $smarty.get.source_type_soft=='clients'}selected{/if}>{t t='Klientai'}</option>{/if}
			{if $site_permission.subscribe_news == 1}<option value="subscribe_news" {if ($job_data.source_type == 'subscribe_news' && !$smarty.get.source_type_soft)  || $smarty.get.source_type_soft=='subscribe_news'}selected{/if}>{t t='Naujienų prenumerata'}</option>{/if}
			<option value="files" {if ($job_data.source_type == 'files' && !$smarty.get.source_type_soft)  || $smarty.get.source_type_soft=='files'}selected{/if}>{t t='Tekstinis failas'}</option>
			<option value="textfield" {if ($job_data.source_type == 'textfield' && !$smarty.get.source_type_soft)  || $smarty.get.source_type_soft=='textfield'}selected{/if}>{t t='Paprastas tekstas'}</option>
		</select>		
		</td>	
		<td width="20"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
		<td>{t t='Šiuo metu pasirinkta'}: {t t=$job_data.source_type}</td>	
	</tr>
	
</table>



 <!-- *  -->
{if ($job_data.source_type == 'clients' && !$smarty.get.source_type_soft) || $smarty.get.source_type_soft=='clients'}
<input type="hidden" name="source_type" value="clients">
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#F8F9F9" style="border-bottom:1px solid #DBE1E5 ">			
	<tr>
		<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
		<td height="30">{t t='Pasirinkite klientų grupes kurioms norite išsiųsti laiškus.'}</td>		
	</tr>
</table>	
<table width="100%" cellpadding="0" cellspacing="0">	
	<tr>
		<td height="12"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
	</tr>	
</table>
{ext->class_function class="clients" func="get_clients_group" assign="groups_list"}
{ext->countArray array=$groups_list assign="groups_count"}
{if $groups_count > 0}
	<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
		<tr>		
			<td  height="20" style="font-size:9px; color:#4C4C4C; text-align:center; border-right:1px solid #D6DBDE" width="70">{t t='Žymėjimas'}</td>	
			<!-- <td  height="20" style="font-size:9px; color:#4C4C4C; text-align:center; border-right:1px solid #D6DBDE" width="50">ID</td>						
			<td  height="20" style="font-size:9px; color:#4C4C4C; text-align:center; border-right:1px solid #D6DBDE" width="50">level</td>					-->	
			<td style="font-size:9px; color:#4C4C4C; text-align:left; padding:0px 0px 0px 10px">{t t='Pavadinimas'}</td>			
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	{foreach from=$groups_list item="el"}
		<!-- * -->
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
		</table>
		<table width="100%" cellpadding="0" cellspacing="0" bgcolor="{if $el.parent}#ffffff{else}#F4F6F7{/if}">
			<tr>			
				<td height="22" width="70" align="center" style="border-right:1px solid #D6DBDE">{assign var='id' value=$el.id}<input name="ids[]" value="{$el.id}" type="checkbox" {if $job_data.source_name.$id!=''} checked{/if}></td>			
				<td style="padding:0px 0px 0px {if $el.parent}50px;{else}10px;{/if} border-right:1px solid #D6DBDE">{$el.name}</td>
			</tr>
		</table>
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
		</table>
		<!-- /* -->
	{/foreach}
{else}
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="50" bgcolor="#FFFFFF" align="center" style="padding:15px">{t t='Nėra nei vienos grupes'}</td>		
	</tr>
</table>
{/if}


{/if}
<!-- /*  -->

{if ($job_data.source_type == 'subscribe_news' && !$smarty.get.source_type_soft)  || $smarty.get.source_type_soft=='subscribe_news'}
{ext->class_function class="subscribe_news" func="get_all_subscribers" assign="clients_list"}
<input type="hidden" name="source_type" value="subscribe_news">
		<table width="100%" cellpadding="0" cellspacing="0">			
			<tr style="border-top:1px solid #DBE1E5 " bgcolor="#F8F9F9">
				<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
				<td height="30">{t t='Laiškai bus siunčiami visiems žmonėms kurie užsiprenumeravo naujienas.'}</td>		
			</tr>
		</table>		
					
{/if}

{if ($job_data.source_type == 'files' && !$smarty.get.source_type_soft)  || $smarty.get.source_type_soft=='files'}
<input type="hidden" name="source_type" value="files">
		<table width="100%" cellpadding="0" cellspacing="0">			
			<tr style="border-top:1px solid #DBE1E5 " bgcolor="#F8F9F9">
				<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
				<td height="30">{t t='Pasirinkite failą su adresais. Adresai privalo būti surašyti po vieną vienoje eilutėje. Pasikartojantys ir neteisingi adresai nebus importuoti.'}</td>		
			</tr>
		</table>	
		<table width="100%" cellpadding="0" cellspacing="0">	
			<tr>
				<td height="12"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
			</tr>	
		</table>	
		<table width="100%" cellpadding="0" cellspacing="0" style="border-top:1px solid #DBE1E5 " bgcolor="#F8F9F9">			
			<tr >
				<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
				<td style="padding:10px 0px 10px 0px ">
					<input name="source_name" type="file" style="width:450px ">
				</td>		
			</tr>			
		</table>		
{/if}

{if ($job_data.source_type == 'textfield' && !$smarty.get.source_type_soft)  || $smarty.get.source_type_soft=='textfield'}
		<input type="hidden" name="source_type" value="textfield">
		<table width="100%" cellpadding="0" cellspacing="0">			
			<tr style="border-top:1px solid #DBE1E5 " bgcolor="#F8F9F9">
				<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
				<td height="30">{t t='Į žemiau esanti lauką galite įvesti gavėjų adresus. Adresus būtina rašyti po vieną vienoje eilutėje. Pasikartojantys ir neteisingi adresai nebus importuoti.'}</td>		
			</tr>
		</table>		
		<table width="100%" cellpadding="0" cellspacing="0">	
			<tr>
				<td height="12"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
			</tr>	
		</table>
{capture name="job_emails"}{foreach from=$job_emails item="el"}{$el}
{/foreach}{/capture}
		{assign var="el_name" value="address_list"}
		{assign var="el_value" value=$smarty.capture.job_emails}
		{include file="admin/modules/letters/fields/textarea.tpl"}
		
{/if}
		
		{if $job_data.source_type==$smarty.get.source_type_soft || !$smarty.get.source_type_soft}
		<table width="100%" cellpadding="0" cellspacing="0">	
			<tr>
				<td height="12"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
			</tr>	
		</table>	
		<table width="100%" cellpadding="0" cellspacing="0" style="border-top:1px solid #DBE1E5 ">			
			<tr bgcolor="#F8F9F9">
				<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
				<td height="30">{t t='Laišką gaus'}: {ext->countArray array=$job_emails}</td>		
			</tr>
		</table>	
		{/if}
</form>

</td>		
</tr>
</table>
				
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td bgcolor="#FFFFFF" height="5">						
						<input onClick="doSubmit('child_list'); return false;" type="button" value="{t t="Išsaugoti pakeitimus"}" class="defaultFormButton" style="margin:10px ">
						</td>		
					</tr>
				</table>
				
				</td>	
				<td width="1" bgcolor="#DBE1E5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
		</table>

<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="1" bgcolor="#DBE1E5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
	</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="20"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>		
	</tr>
</table>
